<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/boot.js"></script>
</head>

<body>
    <div id="container">
        <div id="formcontainer">
            <ul id="datatree" class="ztree"></ul>
        </div>
        <div id="opcontainer">
            <button class="layui-btn" type="button" onclick="HandleSave()">确认</button>
            <button class="layui-btn layui-btn-primary" onclick="HandleClose()">关闭</button>
        </div>
    </div>
</body>
<script>
    $(function() {
        BindData();
    })

    function BindData() {
        var setting = {
            check: {
                enable: true,
                chkStyle: "checkbox",
		        chkboxType: { "Y": "ps", "N": "ps" }
            }
        }

        BindTreeV2("datatree", "system/org/dept/tree", null, function(result,data){
            var SelectNodeIDList = GetParam();
            if(SelectNodeIDList){
                SetCheckedNodes('datatree',SelectNodeIDList);
            }
        },null, setting);
       
    }

    function HandleSave() {
        var NodeList = GetTreeCheckedNodes('datatree');
        CloseDialog(NodeList);
    }

    function HandleClose() {
        CloseDialog();
    }
</script>

</html>